<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  </head>
  <style>
    /* 
    第一种：flex弹性盒子
     */
    /* * {
      margin: 0;
      padding: 0
    }

    .parent {
      width: 100%;
      height: 100px;
      background-color: blue;

    }

    ul {
      list-style-type: none;
      display: flex;
    }

    ul>li {
      width: 100px;
      height: 100px;
      background-color: red;
      margin-right: 10px;
      flex: 1;
    } */


    /* 
    第二种：float+margin
     */
    /* * {
      margin: 0;
      padding: 0
    }

    .parent {
      width: 100%;
      height: 100px;
      background-color: blue;

    }

    ul {
      list-style-type: none;
      margin-left: -10px;
    }

    ul>li {
      height: 100px;
      width: 5%;
      background-color: red;
      padding-left: 10px;
      float: left;
      box-sizing: border-box;
    } */

    /* 
    第三种：table+margin
     */
    * {
      margin: 0;
      padding: 0
    }

    .parent {
      width: 100%;
      height: 100px;
      background-color: blue;

    }

    ul {
      list-style-type: none;
      display: table;
      width: 100%;
      table-layout: fixed
    }

    ul>li {
      height: 100px;
      width: 5%;
      background-color: red;
      display: table-cell;
    }
  </style>

  <body>
    <div class="parent">
      <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
        <li>9</li>
        <li>10</li>
        <li>11</li>
        <li>12</li>
        <li>13</li>
        <li>14</li>
        <li>15</li>
        <li>16</li>
        <li>17</li>
        <li>18</li>
        <li>19</li>
        <li>20</li>
      </ul>
    </div>
  </body>

</html>